From c375307638a70b66886268af40b10ba1a06495e7 Mon Sep 17 00:00:00 2001 From: Ewan Mellor Date: Thu, 22 Mar 2007 19:04:45 +0000 Subject: [PATCH] Implemented host.get_PIFs. Signed-off-by: Ewan Mellor --- tools/python/xen/xend/XendAPI.py | 3 +++ tools/python/xen/xend/XendNode.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/tools/python/xen/xend/XendAPI.py b/tools/python/xen/xend/XendAPI.py index e7b408ae3c..5bba6cdf33 100644 --- a/tools/python/xen/xend/XendAPI.py +++ b/tools/python/xen/xend/XendAPI.py @@ -643,6 +643,7 @@ class XendAPI(object): host_attr_ro = ['software_version', 'resident_VMs', + 'PIFs', 'host_CPUs', 'cpu_configuration', 'metrics', @@ -712,6 +713,8 @@ class XendAPI(object): return xen_api_success(XendNode.instance().xen_version()) def host_get_resident_VMs(self, session, host_ref): return xen_api_success(XendDomain.instance().get_domain_refs()) + def host_get_PIFs(self, session, ref): + return xen_api_success(XendNode.instance().get_PIF_refs()) def host_get_host_CPUs(self, session, host_ref): return xen_api_success(XendNode.instance().get_host_cpu_refs()) def host_get_metrics(self, _, ref): diff --git a/tools/python/xen/xend/XendNode.py b/tools/python/xen/xend/XendNode.py index 3917c8080c..b8b9800602 100644 --- a/tools/python/xen/xend/XendNode.py +++ b/tools/python/xen/xend/XendNode.py @@ -215,6 +215,10 @@ class XendNode: self.save_networks() + def get_PIF_refs(self): + return self.pifs.keys() + + def _PIF_create(self, name, mtu, vlan, mac, network, persist = True, pif_uuid = None, metrics_uuid = None): for pif in self.pifs.values(): -- 2.30.2